package org.aplombh.java.interview.newcoder;

import java.util.Scanner;

//HJ13 句子逆序
public class HJ13_句子逆序 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String a = in.nextLine();
        String[] s = a.split(" ");
        for (int i = s.length - 1; i >= 0; i--) {
            for (int j = s[i].length() - 1; j >= 0; j--) {
                System.out.print(s[i].charAt(j));
            }
            if (i == 0) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }
}